<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>bonobo-application</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Libbonobo Reference Manual">
<link rel="up" href="general.html" title="General">
<link rel="prev" href="libbonobo-bonobo-exception.html" title="bonobo-exception">
<link rel="next" href="libbonobo-bonobo-app-client.html" title="bonobo-app-client">
<meta name="generator" content="GTK-Doc V1.15.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libbonobo-bonobo-exception.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Libbonobo Reference Manual</th>
<td><a accesskey="n" href="libbonobo-bonobo-app-client.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libbonobo-bonobo-application.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libbonobo-bonobo-application.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libbonobo-bonobo-application"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libbonobo-bonobo-application.top_of_page"></a>bonobo-application</span></h2>
<p>bonobo-application — a framework for unique application instance and automation</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libbonobo-bonobo-application.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><span class="returnvalue">void</span>                (<a class="link" href="libbonobo-bonobo-application.html#BonoboAppHookFunc" title="BonoboAppHookFunc ()">*BonoboAppHookFunc</a>)                (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">BonoboApplication</span> *         <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-new" title="bonobo_application_new ()">bonobo_application_new</a>      (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-register-message" title="bonobo_application_register_message ()">bonobo_application_register_message</a> (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *description</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *opt_closure</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_type</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> first_arg_type</code></em>,
                                                         <em class="parameter"><code>...</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-register-message-v" title="bonobo_application_register_message_v ()">bonobo_application_register_message_v</a>
                                                        (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *description</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *opt_closure</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_type</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> const arg_types[]</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-register-message-va" title="bonobo_application_register_message_va ()">bonobo_application_register_message_va</a>
                                                        (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *description</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *opt_closure</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_type</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> first_arg_type</code></em>,
                                                         <em class="parameter"><code><span class="type">va_list</span> var_args</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-new-instance" title="bonobo_application_new_instance ()">bonobo_application_new_instance</a>     (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> argc</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *argv[]</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *                    <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-create-serverinfo" title="bonobo_application_create_serverinfo ()">bonobo_application_create_serverinfo</a>
                                                        (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> const *envp[]</code></em>);
<span class="returnvalue">Bonobo_RegistrationResult</span>  <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-register-unique" title="bonobo_application_register_unique ()">bonobo_application_register_unique</a>
                                                        (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> const *serverinfo</code></em>,
                                                         <em class="parameter"><code><span class="type">BonoboAppClient</span> **client</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-add-hook" title="bonobo_application_add_hook ()">bonobo_application_add_hook</a>         (<em class="parameter"><code><a class="link" href="libbonobo-bonobo-application.html#BonoboAppHookFunc" title="BonoboAppHookFunc ()"><span class="type">BonoboAppHookFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-remove-hook" title="bonobo_application_remove_hook ()">bonobo_application_remove_hook</a>      (<em class="parameter"><code><a class="link" href="libbonobo-bonobo-application.html#BonoboAppHookFunc" title="BonoboAppHookFunc ()"><span class="type">BonoboAppHookFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-application.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-application.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="BonoboAppHookFunc"></a><h3>BonoboAppHookFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*BonoboAppHookFunc)                (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>app</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-new"></a><h3>bonobo_application_new ()</h3>
<pre class="programlisting"><span class="returnvalue">BonoboApplication</span> *         bonobo_application_new      (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
<p>
Creates a new <span class="type">BonoboApplication</span> object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>application name
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <span class="type">BonoboApplication</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-register-message"></a><h3>bonobo_application_register_message ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                bonobo_application_register_message (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *description</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *opt_closure</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_type</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> first_arg_type</code></em>,
                                                         <em class="parameter"><code>...</code></em>);</pre>
<p>
Registers a new message type that the application supports.
</p>
<p>
When <em class="parameter"><code>opt_closure</code></em> is provided (and is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) it takes care of calling the
callback function with the same arguments as registered for the message.  On
the other hand if <em class="parameter"><code>opt_closure</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the function arguments are provided in
a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Value-arrays.html#GValueArray"><span class="type">GValueArray</span></a>.  This enables defining functions that accept variable number of
arguments, but is perhaps a little more tedious to implement.
</p>
<p>
</p>
<div class="example">
<a name="id3075038"></a><p class="title"><b>Example 5. Function with a closure</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">message_open_url_cb</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">BonoboApplication</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">app</span><span class="symbol">,</span><span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">url</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gboolean</span><span class="normal"> new_win</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">    </span><span class="symbol">...</span>
<span class="cbracket">}</span>
<span class="symbol">...</span>
<span class="normal">closure </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#g-cclosure-new">g_cclosure_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">message_open_url_cb</span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#g-closure-set-marshal">g_closure_set_marshal</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">closure</span><span class="symbol">,</span><span class="normal"> my_marshal_VOID__STRING_BOOLEAN</span><span class="symbol">);</span>
<span class="function"><a href="libbonobo-bonobo-application.html#bonobo-application-register-message">bonobo_application_register_message</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">app</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"open-url"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Opens a new URL in the browser."</span>
<span class="normal">                                     </span><span class="string">" Parameters: url(string), open-in-new-window(boolean)"</span><span class="symbol">,</span>
<span class="normal">                                     closure</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS">G_TYPE_NONE</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-STRING:CAPS">G_TYPE_STRING</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-BOOLEAN:CAPS">G_TYPE_BOOLEAN</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS">G_TYPE_NONE</a></span><span class="symbol">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<p><br class="example-break">
</p>
<p>
</p>
<div class="example">
<a name="id3075063"></a><p class="title"><b>Example 6. Function accepting variable number of arguments</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue">GValue</a> </span><span class="symbol">*</span>
<span class="function">message_open_url_cb</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">BonoboApplication</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">app</span><span class="symbol">,</span><span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">message</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GValueArray</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">args</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">    </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">url</span><span class="symbol">;</span>
<span class="normal">    </span><span class="usertype">gboolean</span><span class="normal">    new_win </span><span class="symbol">=</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">;</span>
<span class="normal">    </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">strcmp</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">message</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"open-url"</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">    </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">args</span><span class="symbol">-&gt;</span><span class="normal">n_values </span><span class="symbol">&gt;</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">    </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#G-VALUE-HOLDS-STRING:CAPS">G_VALUE_HOLDS_STRING</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">args</span><span class="symbol">-&gt;</span><span class="normal">values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">]),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">    url </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-value-get-string">g_value_get_string</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">args</span><span class="symbol">-&gt;</span><span class="normal">values</span><span class="symbol">[</span><span class="number">0</span><span class="symbol">]);</span>
<span class="normal">    </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">args</span><span class="symbol">-&gt;</span><span class="normal">n_values </span><span class="symbol">&gt;</span><span class="normal"> </span><span class="number">1</span><span class="symbol">)</span>
<span class="normal">    </span><span class="cbracket">{</span>
<span class="normal">        </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-val-if-fail">g_return_val_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#G-VALUE-HOLDS-BOOLEAN:CAPS">G_VALUE_HOLDS_BOOLEAN</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">args</span><span class="symbol">-&gt;</span><span class="normal">values</span><span class="symbol">[</span><span class="number">1</span><span class="symbol">]),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
<span class="normal">        new_win </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Standard-Parameter-and-Value-Types.html#g-value-get-boolean">g_value_get_boolean</a></span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">args</span><span class="symbol">-&gt;</span><span class="normal">values</span><span class="symbol">[</span><span class="number">1</span><span class="symbol">]);</span>
<span class="normal">    </span><span class="cbracket">}</span>
<span class="normal">    </span><span class="symbol">...</span>
<span class="normal">    </span><span class="keyword">return</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">;</span>
<span class="cbracket">}</span>
<span class="symbol">...</span>
<span class="function"><a href="libbonobo-bonobo-application.html#bonobo-application-register-message">bonobo_application_register_message</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">app</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"open-url"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Opens a new URL in the browser."</span>
<span class="normal">                                     </span><span class="string">" Parameters: url(string) [, open-in-new-window(boolean)]"</span><span class="symbol">,</span>
<span class="normal">                                     <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS">G_TYPE_NONE</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-STRING:CAPS">G_TYPE_STRING</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-BOOLEAN:CAPS">G_TYPE_BOOLEAN</a></span><span class="symbol">,</span><span class="normal"> <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS">G_TYPE_NONE</a></span><span class="symbol">);</span>
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">app</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"message::open-url"</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">message_open_url_cb</span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<p><br class="example-break">
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>You are not required to register any messages for your application.
However, only registered functions are included in the list returned by
<code class="function">bonobo_app_client_msg_list()</code>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>app</code></em> :</span></p></td>
<td>a <span class="type">BonoboApplication</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>message string identifier
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>description</code></em> :</span></p></td>
<td>a string containing a human readable description of the message
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>opt_closure</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> that will be called for this message, or
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; Function takes ownership of this closure.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>return_type</code></em> :</span></p></td>
<td>Message return <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>first_arg_type</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of first argument of message, or <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS"><code class="literal">G_TYPE_NONE</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS"><code class="literal">G_TYPE_NONE</code></a> -terminated list of argument <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>'s
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-register-message-v"></a><h3>bonobo_application_register_message_v ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                bonobo_application_register_message_v
                                                        (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *description</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *opt_closure</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_type</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> const arg_types[]</code></em>);</pre>
<p>
See <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-register-message" title="bonobo_application_register_message ()"><code class="function">bonobo_application_register_message()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>app</code></em> :</span></p></td>
<td>a <span class="type">BonoboApplication</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>message string identifier
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>description</code></em> :</span></p></td>
<td>a string containing a human readable description of the message
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>opt_closure</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> that will be called for this message, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>;
Function takes ownership of this closure.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>return_type</code></em> :</span></p></td>
<td>Message return <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>arg_types</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS"><code class="literal">G_TYPE_NONE</code></a> -terminated vector of argument <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>'s
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-register-message-va"></a><h3>bonobo_application_register_message_va ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                bonobo_application_register_message_va
                                                        (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *description</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> *opt_closure</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_type</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> first_arg_type</code></em>,
                                                         <em class="parameter"><code><span class="type">va_list</span> var_args</code></em>);</pre>
<p>
See <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-register-message" title="bonobo_application_register_message ()"><code class="function">bonobo_application_register_message()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>app</code></em> :</span></p></td>
<td>a <span class="type">BonoboApplication</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>message string identifier
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>description</code></em> :</span></p></td>
<td>a string containing a human readable description of the message
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>opt_closure</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GClosure"><span class="type">GClosure</span></a> that will be called for this message, or
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; Function takes ownership of this closure.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>return_type</code></em> :</span></p></td>
<td>Message return <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>first_arg_type</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of first argument of message, or <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS"><code class="literal">G_TYPE_NONE</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>var_args</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-NONE:CAPS"><code class="literal">G_TYPE_NONE</code></a> -terminated valist of argument <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>'s
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-new-instance"></a><h3>bonobo_application_new_instance ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                bonobo_application_new_instance     (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> argc</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *argv[]</code></em>);</pre>
<p>
Emit the "new-instance" signal of the <span class="type">BonoboApplication</span> with the
given arguments.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>app</code></em> :</span></p></td>
<td>a <span class="type">BonoboApplication</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>number of elements in <em class="parameter"><code>argv</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>array of strings (command-line arguments)
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> signal return value
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-create-serverinfo"></a><h3>bonobo_application_create_serverinfo ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *                    bonobo_application_create_serverinfo
                                                        (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> const *envp[]</code></em>);</pre>
<p>
This utility function provides a simple way to contruct a valid
serverinfo XML string.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>app</code></em> :</span></p></td>
<td>a <span class="type">BonoboApplication</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>envp</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated string vector, containing the enviroment
variables we wish to include in the server description.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly allocated string; caller must <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> it.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-register-unique"></a><h3>bonobo_application_register_unique ()</h3>
<pre class="programlisting"><span class="returnvalue">Bonobo_RegistrationResult</span>  bonobo_application_register_unique
                                                        (<em class="parameter"><code><span class="type">BonoboApplication</span> *app</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> const *serverinfo</code></em>,
                                                         <em class="parameter"><code><span class="type">BonoboAppClient</span> **client</code></em>);</pre>
<p>
Try to register the running application, or check for an existing
application already registered and get a reference to it.
Applications already running but on different environments (as
defined by the bonobo:environenment server property) than this one
are ignored and do not interfere.
</p>
<p>
If the registration attempt indicates that another instance of this
application is already running, then the output variable
<em class="parameter"><code>client</code></em> will receive a newly created <span class="type">BonoboAppClient</span>
associated with the running application.  Otherwise, *<em class="parameter"><code>client</code></em> is
set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>app</code></em> :</span></p></td>
<td>a <span class="type">BonoboApplication</span> instance
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>serverinfo</code></em> :</span></p></td>
<td>the XML server
description. <code class="function">bonobo_application_create_server_description()</code> may be
used to easily create such description.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
<td>output parameter that will contain a client object, in
case another instance has already running, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if we are the
first to register.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the registration result.
<code class="literal">Bonobo_ACTIVATION_REG_SUCCESS</code> means the application was registered,
since no other running instance was detected.  If, however, a
running application is detected,
<code class="literal">Bonobo_ACTIVATION_REG_ALREADY_ACTIVE</code> is returned.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-add-hook"></a><h3>bonobo_application_add_hook ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                bonobo_application_add_hook         (<em class="parameter"><code><a class="link" href="libbonobo-bonobo-application.html#BonoboAppHookFunc" title="BonoboAppHookFunc ()"><span class="type">BonoboAppHookFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Add a hook function to be called whenever a new <span class="type">BonoboApplication</span>
instance is created.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>hook function
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user data
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="bonobo-application-remove-hook"></a><h3>bonobo_application_remove_hook ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                bonobo_application_remove_hook      (<em class="parameter"><code><a class="link" href="libbonobo-bonobo-application.html#BonoboAppHookFunc" title="BonoboAppHookFunc ()"><span class="type">BonoboAppHookFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Removes a hook function previously set with <a class="link" href="libbonobo-bonobo-application.html#bonobo-application-add-hook" title="bonobo_application_add_hook ()"><code class="function">bonobo_application_add_hook()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>hook function
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user data
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15.1</div>
</body>
</html>